<!DOCTYPE html>
<html xmlns:th="http://www.thymeleaf.org"
      xmlns:shiro="http://www.pollix.at/thymeleaf/shiro">
<head th:include="include :: header"></head>
<body class="hold-transition skin-blue sidebar-mini">
<section class="content-header">
    <h1>
        项目变更查询
    </h1>
</section>
<section class="content">
    <div class="row">
        <div class="col-md-12">
            <div class="box">

                <div class="box-header">
                    <form id="queryForm" onsubmit="return false;">
                        <div class="row">
                            <div class="form-inline">
                                <div class="form-group" style="margin-right: 10px;">
                                    <label>项目编号</label>
                                    <input type="text" name="code" class="form-control" placeholder="请输入项目编号">
                                </div>
                                <div class="form-group" style="margin-right: 10px;">
                                    <label>项目名称</label>
                                    <input type="text" name="name" class="form-control" placeholder="请输入项目名称">
                                </div>
                                <div class="form-group">
                                    <label for="query-startTime">变更时间</label>
                                    <input id="query-startTime" type="text" class="form-control datepicker"
                                           name="changStartDT"
                                           readonly="readonly"/>
                                    <label for="query-endTime"> 至 </label>
                                    <input id="query-endTime" type="text" class="form-control datepicker" name="changEndDT"
                                           readonly="readonly"/>
                                </div>
                                <div class="form-group">
                                    <label for="query-gradeType">变更类型</label>
                                    <select id="query-gradeType" class="form-control" name="chgType">
                                        <option value="" selected>请选择</option>
                                        <option value="内容变更">内容变更</option>
                                        <option value="取消项目">取消项目</option>
                                        <option value="恢复项目">恢复项目</option>
                                    </select>
                                </div>

                                <button type="button" class="btn btn-success" id="btn-search" style="margin-top: 5px;">
                                    <!--<i class="fa fa-search"></i>-->
                                    <span class="Bold">搜索</span>
                                </button>
                            </div>
                        </div>
                    </form>
                </div>
                <div class="box-body">
                    <table id="bootstrap-table" style="table-layout: fixed;word-break:break-all; word-wrap:break-word;"></table>
                </div>
            </div>
        </div>
    </div>
</section>
<div th:include="include :: footer"></div>
<script th:inline="javascript">
    /**
     * 表格搜索
     */
    $("#btn-search").click(function () {
        js.table.search(table);
    });

    /** 加载用户表格 */
    table = js.table.init({
        url: ctx + "projectScheduling/selectProjectChangeList",
        showColumns: false,
        showExport: true,
        exportDataType:'all',
        pageSize:300,
        columns: [
            {
                title: '序号', field: 'id', width: '50',
                formatter: function (value, row, index, field) {
                    var pageSize = table.bootstrapTable('getOptions').pageSize;
                    var pageNumber = table.bootstrapTable('getOptions').pageNumber;
                    return pageSize * (pageNumber - 1) + index + 1;
                }
            },
            {title: '项目编号', field: 'code',width:'100'},
            {title: '项目名称', field: 'name',width:'300'},
            {title: '需方', field: 'demander',width:'240'},
            {title: '安装地点', field: 'address',width:'240'},
            {title: '数量', field: 'num',width:'50'},
            {title: '备注', field: 'remark'},
            // {title: "变更内容", field: 'chgContent'},
            {title: "变更类型", field: 'chgType'
                // ,
                // formatter: function(value, row, index){
                //     if(value=="内容变更"){
                //         return '<span class="label badge" style="background-color:#337ab7;">内容变更</span>';
                //     }else if(value=="取消项目"){
                //         return '<span class="label badge bg-yellow">取消项目</span>';
                //     }else if(value=="恢复项目"){
                //         return '<span class="label badge bg-green">恢复项目</span>';
                //     }
                // }
            },
            {title: "变更时间", field: 'changDT',width:'100'},
            {
                title: "操作",
                width: '70',
                formatter: function (value, row, index) {
                    var actions = [];
                    // actions.push('<a class="btn btn-info btn-xs" href="' + ctx + 'taskDetailBoard?id= ' + row.id + '&code='+ row.code + '&name='+ row.name + '&demander='+ row.demander + '&num='+ row.num + '&address='+ row.address + '&projectClassify='+ row.projectClassify + '"> 查看</a> ');

                    actions.push('<a  shiro:hasPermission="task:board:view" class="btn btn-info btn-xs"  target="_blank" href="' + ctx + 'projectChange/chgInfo/viewInfo/' + row.id + '"> 查看</a> ');

                    return actions.join('');
                }
            }
        ]
    });


</script>
</body>
</html>
